<template>
     <div class='cxo'>
        <v-header title='集团总部数据看板' :subhead='$route.query.q'></v-header>
         <v-detail v-if='res.headquarters' :subhead='$route.query.q' :info='res.headquarters' title='集团总部数据看板' userType="U" ></v-detail>
         <echart-list :res='res' v-if='res' :subhead='$route.query.q'></echart-list>
        <v-footer></v-footer>
    </div>
</template>
<script>
import Header from "../dataLookCommon/_header";
import Detail from "../dataLookCommon/_detail";
import echartList from "../dataLookCommon/echartList";
import Footer from "../dataLookCommon/_footer";
import URL from "../../common/js/dataLookUrl";

export default {
  components: {
    "v-header": Header,
    "v-detail": Detail,
    echartList,
    "v-footer": Footer
  },

  data() {
    return {
      res: ""
    };
  },
  watch: {
    '$route'(to, from) {
      if(to!== from) {
        this.sendAjax()
        
      }
    }
  },
  created() {
     this.sendAjax()
  },
  methods:{
    sendAjax(){
      let params = {
        deptCategory: this.$route.query.q
      };  
      console.log(this.$route.query.q,'this.$route.query.q')
      this.Axios
        .Post(URL.geteheadquartersBydata.url, params)
        .then(res => (this.res = res.data.datas));
    }
  }
};
</script>

<style scoped>
.cxo {
  overflow-x: hidden;
}
</style>